//
//  ImageButton.m
//  Kitchen
//
//  Created by 王枫楠 on 15/11/27.
//  Copyright © 2015年 深圳创世易明科技有限公司. All rights reserved.
//

#import "ImageButton.h"

@implementation ImageButton

- (CGRect)imageRectForContentRect:(CGRect)contentRect{
    CGFloat imageW = contentRect.size.width * 0.5;
    CGFloat imageH = contentRect.size.height * 0.5;
    return CGRectMake((self.frame.size.width - imageW)/2, 20, imageW, imageH);
}

- (CGRect)titleRectForContentRect:(CGRect)contentRect{
    CGFloat titleY = contentRect.size.height * 0.8;
    CGFloat titleW = contentRect.size.width;
    CGFloat titleH = contentRect.size.height - titleY;

    return CGRectMake((self.frame.size.width - titleW)/2, titleY, titleW, titleH);
}

@end
